@import '../../../styles/var';

@calendar: ~'@{prefix}-calendar';
@icon: ~'@{prefix}-icon';

.@{calendar}-month {
  position: relative;
  border: 1px solid @border-lighter-color;
}

.@{calendar}-month + .@{calendar}-month {
  margin-top: -1px;
}

.@{calendar}-month {
  &:before {
    content: '';
    display: block;
    position: absolute;
    height: 1px;
    border-top: 1px solid @secondary-color;
    margin-left: -1px;
    margin-top: -1px;
  }

  &:first-child {
    &:before {
      display: none;
    }
  }
}

.@{calendar}-sidebar {
  width: 75px;
  position: absolute;
  bottom: 0;
  right: 0;
  top: 0;
  padding-top: 41px;
}

.@{calendar}-prev,
.@{calendar}-next {
  font-size: 0;
  visibility: hidden;
  width: 75px;
  height: 95px;
  position: relative;
  box-sizing: border-box;

  &:focus {
    outline: none;
  }

  .@{icon} {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 36px;
    color: @secondary-lighter-color;
    transform: translate(-50%, -50%);
  }

  &:hover {
    .@{icon} {
      color: @secondary-darker-color;
    }
  }

  &.is-disabled {
    .@{icon} {
      color: @font-light-color;
    }
  }

  &:focus {
    &:not(.is-disabled) {
      border: 1px solid @secondary-light-color;
      box-shadow: 0 0 0 1px @secondary-light-color;
    }
  }

  &:focus,
  &:hover {
    &:not(.is-disabled) {
      cursor: pointer;
      background-color: @secondary-background;
    }
  }
}

.@{calendar}-next {
  bottom: 0;
}

.@{calendar}-month:first-child {
  .@{calendar}-prev {
    visibility: visible;
  }
}

.@{calendar}-month:last-child {
  .@{calendar}-next {
    visibility: visible;
  }
}

.@{calendar}-title {
  hyphens: auto;
  text-align: center;
  font-size: 0;
  width: 75px;
  height: calc(100% - 95px * 2);
  color: @font-lighter-color;
  padding: 5px 5px 5px 5px;
  box-sizing: border-box;
}

.@{calendar}-title-support {
  display: inline-block;
  width: 0;
  font-size: 0;
  height: 100%;
  vertical-align: middle;
}

.@{calendar}-title-text {
  font-size: 16px;
  display: inline-block;
  vertical-align: middle;
  word-break: break-all;
  white-space: pre-line;
  width: 100%;
}

.@{calendar}-header {
  border-bottom: 1px solid @border-lighter-color;
  padding-right: 75px;
}

.@{calendar}-weeks {
  height: 40px;
}

.@{calendar}-week {
  color: @font-lighter-color;
  box-sizing: border-box;
  width: calc(100% / 7);
  display: inline-block;
  vertical-align: top;
  height: 40px;
  font-size: 16px;
  text-align: center;
  line-height: 20px;
  padding: 10px;

  &.@{calendar}-sun,
  &.@{calendar}-sat {
    color: @secondary-color;
  }
}

.@{calendar}-content {
  position: relative;
  padding-right: 75px;
}

.@{calendar}-dates {
  padding: 1px 0 0 1px;
  margin: -1px;
}

.@{calendar}-date {
  position: relative;
  display: inline-block;
  vertical-align: top;
  width: calc((100% - 1px) / 7 + 1px);
  height: 96px;
  border: 1px solid @border-lighter-color;
  box-sizing: border-box;
  margin-left: -1px;
  margin-top: -1px;

  &.is-prev,
  &.is-next {
    color: @font-light-color;
  }

  &.is-disabled {
    color: @font-light-color;
  }
}

.@{calendar}-date-number {
  position: absolute;
  top: 10px;
  left: 10px;
  height: 12px;
  line-height: 12px;
}
